#ifndef KLOOPPLAYPAGE_H
#define KLOOPPLAYPAGE_H

#include <QWidget>
#include "../screencapsdk_global.h"

namespace kdk {

class KLoopPlayPagePrivate;

/**
 * @brief FormModule
 * @since 2.5
 */

class SCREENCAPSDK_EXPORT KLoopPlayPage :public QWidget
{
    Q_OBJECT
public:
    KLoopPlayPage(QWidget* parent = nullptr);

    /**
     * @brief 添加widget
     * @param widget
     */
    void addWidget(QWidget *widget);

    /**
     * @brief 删除widget
     * @param widget
     */
    void removeWidget(QWidget *widget);

    /**
     * @brief 设置当前中心界面
     * @param i
     */
    void setCurrentWidget(int i);

    /**
     * @brief 获取当前中心界面index
     * @return
     */
    int  currentWidget();

    /**
     * @brief 设置窗体间距
     * @param spacing
     */
    void setWidgetSpacing(int spacing);

    /**
     * @brief 设置轮播时长
     * @param time
     */
    void setLoopTime(int time);

Q_SIGNALS:
    void leftClick();
    void centerClick();
    void rightClick();

protected:
    void resizeEvent(QResizeEvent *event);
    void paintEvent(QPaintEvent* event);
    void showEvent(QShowEvent *event) override;

private:
    KLoopPlayPagePrivate *const d_ptr;
    Q_DECLARE_PRIVATE(KLoopPlayPage)
};

}

#endif // KLOOPPLAYPAGE_H
